package com.testmycat.zbf.web;

import com.testmycat.zbf.dao.TestRoleMapper;
import com.testmycat.zbf.entity.RoleData;
import com.testmycat.zbf.utils.RandomNameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author: LCG
 * @date: 2022-05-13 19:25:45
 * @description:
 **/
@RestController
@RequestMapping("role")
public class TestRolleController {

    @Autowired
    private TestRoleMapper testRoleMapper;

    @RequestMapping("test01")
    public Object insertTest01(){

        RoleData roleData=new RoleData();
        roleData.setRoleName(RandomNameUtils.getRandomName());
        roleData.setCreateTime(new Date());

        return testRoleMapper.insert(roleData);

    }


    @RequestMapping("test02")
    public Object selectTest02(){
        return testRoleMapper.selectByMap(null);
    }





}
